package com.zhn.evsi.controller.Evsi;

import com.zhn.evsi.common.Result;
import com.zhn.evsi.service.IEvsiAssetsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiSort;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigInteger;
import java.util.Map;

@Api(tags = "资产管理")
@ApiSort(value = 3)
@RestController
@RequestMapping("/Evsi/assets")
public class EvsiAssetsController {

    @Autowired
    private IEvsiAssetsService assetsService;

    @ApiOperation(value = "查询资产")
    @ApiOperationSupport(order = 1)
    @GetMapping("/assetList")
    public Result assetList() {
        return Result.success(assetsService.assetList());
    }

    @ApiOperation(value = "资产所在地点")
    @ApiOperationSupport(order = 2)
    @GetMapping("/assetLocations")
    public Result assetLocations() {
        return Result.success(assetsService.assetLocations());
    }

    @ApiOperation(value = "资产名称")
    @ApiOperationSupport(order = 3)
    @GetMapping("/assetNames")
    public Result assetNames() {
        return Result.success(assetsService.assetNames());
    }

    @ApiOperation(value = "查询军团资产")
    @ApiOperationSupport(order = 4)
    @GetMapping("/assetCorpList")
    public Result assetCorpList() {
        return Result.success(assetsService.assetCorpList());
    }

    @ApiOperation(value = "军团资产所在地点")
    @ApiOperationSupport(order = 5)
    @GetMapping("/assetCropLocations")
    public Result assetCropLocations() {
        return Result.success(assetsService.assetCorpLocations());
    }

    @ApiOperation(value = "军团资产名称")
    @ApiOperationSupport(order = 6)
    @GetMapping("/assetCorpNames")
    public Result assetCorpNames() {
        return Result.success(assetsService.assetCorpNames());
    }

    @ApiOperation("通过资产查询价格等详情")
    @ApiOperationSupport(order = 7)
    @GetMapping("/assetsOnMarket")
    public Result assetsOnMarket(@RequestParam(defaultValue = "") BigInteger locationId,
                                 @RequestParam(defaultValue = "") Integer type,
                                 @RequestParam Integer state){
        // 预估资产价格
        return Result.success(assetsService.assetsOnMarket(locationId, type, state));
    }


}
